﻿@{
    ViewBag.Title = "Они были первыми";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div class="presentation">
    <div class="row">
        <div class="col-xs-6 col-md-2 text-center">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="4">
                <img src="/Content/images/people/no_foto.jpg" alt="">
            </a>
            Авдеев И.М.
        </div>
        <div class="col-xs-6 col-md-2 text-center">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="5">
                <img src="/Content/images/people/no_foto.jpg" alt="">
            </a>
            Прокудин П.И.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="11">
                <img src="/Content/images/photo/archive/IMG_20150601_194502.jpg" alt="">
            </a>
            Петров В.М.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="1">
                <img src="/Content/images/people/kpk/1970. ККП в кабинете.jpg" alt="">
            </a>
            Кондрашова К.П.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="6">
                <img src="/Content/images/people/zavialova/foto/Зоя Моисеевна Завьялова 2013 г..jpg" alt="...">
            </a>
            Завьялова З.М.
        </div>

    </div>

    <div class="row">
        <div class="col-xs-6 col-md-2 text-center">
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="2">
                <img src="/Content/images/photo/archive/4.jpg" alt="">
            </a>
            Переходник Б.Г.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="25">
                <img src="/Content/images/people/25/foto/фотодокументы ФАП01.jpg" alt="...">
            </a>
            Фетисова А.П.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="7">
                <img src="/Content/images/people/loskutov/loskutov.jpg" alt="...">
            </a>
            Лоскутов В.В.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="9">
                <img src="/Content/images/people/nosachev/foto/IMG_20141206_135954.jpg" alt="...">
            </a>
            Носачёв В.И.
        </div>
        <div class="col-xs-6 col-md-2">
            <a href="#" data-toggle="modal" data-target="#myModal" class="thumbnail" data-personid="16">
                <img src="/Content/images/people/kruchek/4_1.jpg" alt="">
            </a>
            Крючек В.К.
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel"></h4>
            </div>
            <div class="modal-body" id="modalBody">
                
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    Закрыть</button>
            </div>
        </div>
    </div>
</div>


<script>
    $('#myModal').on('show.bs.modal', function (event) {
        var button = $(event.relatedTarget); // Button that triggered the modal
        var personid = button.data('personid'); // Extract info from data-* attributes

        
        $.ajax({
          url:"/Archive/Person?personId=" + personid,
//              "@Url.Action("Person", "Archive", new { personId = 3 })",
          cache: false
        })
        .done(function (html) {
          $("#modalBody").html(html);
        });;



        // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
        // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
//        var modal = $(this);
//        modal.find('.modal-title').text('New message to ' + recipient);
//        modal.find('.modal-body').val(recipient);
    })

</script>